<!DOCTYPE HTML>
<html lang="en" >
    
    <head>
        
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <title>伪对象选择器 | Introduction</title>
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <meta name="description" content="">
        <meta name="generator" content="GitBook 2.6.7">
        
        
        <meta name="HandheldFriendly" content="true"/>
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../gitbook/images/apple-touch-icon-precomposed-152.png">
        <link rel="shortcut icon" href="../../gitbook/images/favicon.ico" type="image/x-icon">
        
    <link rel="stylesheet" href="../../gitbook/style.css">
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.css">
        
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-highlight/website.css">
        
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-search/search.css">
        
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-fontsettings/website.css">
        
    
    

        
    
    
    <link rel="next" href="../../First/CSS/样式.html" />
    
    
    <link rel="prev" href="../../First/CSS/属性选择器.html" />
    

        
    </head>
    <body>
        
        
    <div class="book"
        data-level="2.1.8"
        data-chapter-title="伪对象选择器"
        data-filepath="First/CSS/伪对象选择器.md"
        data-basepath="../.."
        data-revision="Fri Sep 01 2017 15:03:43 GMT+0800 (中国标准时间)"
        data-innerlanguage="">
    

<div class="book-summary">
    <nav role="navigation">
        <ul class="summary">
            
            
            
            

            

            
    
        <li class="chapter " data-level="0" data-path="index.html">
            
                
                    <a href="../../index.html">
                
                        <i class="fa fa-check"></i>
                        
                        Introduction
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1" data-path="First/HTML/html1.html">
            
                
                    <a href="../../First/HTML/html1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.</b>
                        
                        HTML5
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1" data-path="First/HTML/example1.html">
            
                
                    <a href="../../First/HTML/example1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.</b>
                        
                        列表之间的同素异性体
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="First/HTML/example2.html">
            
                
                    <a href="../../First/HTML/example2.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.2.</b>
                        
                        常用标签
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="First/HTML/example3.html">
            
                
                    <a href="../../First/HTML/example3.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.3.</b>
                        
                        a标签
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="First/HTML/example4.html">
            
                
                    <a href="../../First/HTML/example4.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.4.</b>
                        
                        HTML5新增加的标签
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="First/HTML/example5.html">
            
                
                    <a href="../../First/HTML/example5.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.5.</b>
                        
                        实体字符和文本格式化
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="First/HTML/example6.html">
            
                
                    <a href="../../First/HTML/example6.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.6.</b>
                        
                        table标签
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="First/HTML/example7.html">
            
                
                    <a href="../../First/HTML/example7.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.7.</b>
                        
                        form表单与input输入框的运用
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="First/HTML/example8.html">
            
                
                    <a href="../../First/HTML/example8.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.8.</b>
                        
                        块级元素与内联元素的往事
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.9" data-path="First/HTML/example9.html">
            
                
                    <a href="../../First/HTML/example9.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.9.</b>
                        
                        零碎小知识
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.10" data-path="First/HTML/example10.html">
            
                
                    <a href="../../First/HTML/example10.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.10.</b>
                        
                        图像热区与内嵌框架iframe的趣事
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.11" data-path="First/HTML/content.html">
            
                
                    <a href="../../First/HTML/content.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.11.</b>
                        
                        HTML5心得和总结
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2" data-path="First/CSS/css1.html">
            
                
                    <a href="../../First/CSS/css1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.</b>
                        
                        CSS3
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1" data-path="First/CSS/css.html">
            
                
                    <a href="../../First/CSS/css.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.</b>
                        
                        CSS选择器
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1.1" data-path="First/CSS/通配选择器.html">
            
                
                    <a href="../../First/CSS/通配选择器.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.1.</b>
                        
                        通配选择器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.1.2" data-path="First/CSS/元素选择器.html">
            
                
                    <a href="../../First/CSS/元素选择器.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.2.</b>
                        
                        元素选择器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.1.3" data-path="First/CSS/class选择器和id选择器.html">
            
                
                    <a href="../../First/CSS/class选择器和id选择器.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.3.</b>
                        
                        class选择器和id选择器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.1.4" data-path="First/CSS/关系选择器.html">
            
                
                    <a href="../../First/CSS/关系选择器.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.4.</b>
                        
                        关系选择器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.1.5" data-path="First/CSS/群组选择器.html">
            
                
                    <a href="../../First/CSS/群组选择器.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.5.</b>
                        
                        群组选择器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.1.6" data-path="First/CSS/伪类选择器.html">
            
                
                    <a href="../../First/CSS/伪类选择器.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.6.</b>
                        
                        伪类选择器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.1.7" data-path="First/CSS/属性选择器.html">
            
                
                    <a href="../../First/CSS/属性选择器.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.7.</b>
                        
                        属性选择器
                    </a>
            
            
        </li>
    
        <li class="chapter active" data-level="2.1.8" data-path="First/CSS/伪对象选择器.html">
            
                
                    <a href="../../First/CSS/伪对象选择器.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.8.</b>
                        
                        伪对象选择器
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.2" data-path="First/CSS/样式.html">
            
                
                    <a href="../../First/CSS/样式.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.2.</b>
                        
                        CSS样式分类
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.2.1" data-path="First/CSS/字体样式.html">
            
                
                    <a href="../../First/CSS/字体样式.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.2.1.</b>
                        
                        字体样式
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.2.2" data-path="First/CSS/边框样式.html">
            
                
                    <a href="../../First/CSS/边框样式.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.2.2.</b>
                        
                        边框样式
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.2.3" data-path="First/CSS/背景样式.html">
            
                
                    <a href="../../First/CSS/背景样式.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.2.3.</b>
                        
                        背景样式
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.2.4" data-path="First/CSS/元素样式.html">
            
                
                    <a href="../../First/CSS/元素样式.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.2.4.</b>
                        
                        元素样式
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.2.5" data-path="First/CSS/段落样式.html">
            
                
                    <a href="../../First/CSS/段落样式.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.2.5.</b>
                        
                        段落样式
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.2.6" data-path="First/CSS/浮动.html">
            
                
                    <a href="../../First/CSS/浮动.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.2.6.</b>
                        
                        浮动
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.2.7" data-path="First/CSS/网页常见定位.html">
            
                
                    <a href="../../First/CSS/网页常见定位.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.2.7.</b>
                        
                        网页常见定位
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.2.8" data-path="First/CSS/盒子模型.html">
            
                
                    <a href="../../First/CSS/盒子模型.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.2.8.</b>
                        
                        盒子模型
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.3" data-path="First/CSS/SCSS预处理.html">
            
                
                    <a href="../../First/CSS/SCSS预处理.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.3.</b>
                        
                        sass预处理用法
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.4" data-path="First/CSS/animate常见用法.html">
            
                
                    <a href="../../First/CSS/animate常见用法.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.4.</b>
                        
                        animate动画
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.5" data-path="First/CSS/媒体查询.html">
            
                
                    <a href="../../First/CSS/媒体查询.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.5.</b>
                        
                        媒体查询
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.6" data-path="First/CSS/Bootstrap框架栅格化系统.html">
            
                
                    <a href="../../First/CSS/Bootstrap框架栅格化系统.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.6.</b>
                        
                        Bootstrap框架栅格化系统
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.7" data-path="First/CSS/flexbox弹性盒子.html">
            
                
                    <a href="../../First/CSS/flexbox弹性盒子.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.7.</b>
                        
                        flexbox弹性盒子
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    


            
            <li class="divider"></li>
            <li>
                <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
                    Published with GitBook
                </a>
            </li>
            
        </ul>
    </nav>
</div>

    <div class="book-body">
        <div class="body-inner">
            <div class="book-header" role="navigation">
    <!-- Actions Left -->
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../../" >Introduction</a>
    </h1>
</div>

            <div class="page-wrapper" tabindex="-1" role="main">
                <div class="page-inner">
                
                
                    <section class="normal" id="section-">
                    
                        <h1 id="&#x4F2A;&#x5BF9;&#x8C61;&#x9009;&#x62E9;&#x5668;">&#x4F2A;&#x5BF9;&#x8C61;&#x9009;&#x62E9;&#x5668;</h1>
<p>&#x7A81;&#x51FA;&#x5BF9;&#x8C61;&#x7684;&#x9009;&#x62E9;&#x5668;</p>
<h3 id="efirstletterefirstletter">E:first-letter/E::first-letter</h3>
<p>&#x8BBE;&#x7F6E;&#x5BF9;&#x8C61;&#x5185;&#x7684;&#x7B2C;&#x4E00;&#x4E2A;&#x5B57;&#x7B26;&#x7684;&#x6837;&#x5F0F;</p>
<pre><code class="lang-css">    &lt;style&gt;
        h1{font-size:16px;}
        p{width:200px;padding:5px 10px;border:1px solid #ddd;font:14px/1.5 simsun,serif,sans-serif;}
        p:first-letter {float:left;font-size:40px;font-weight:bold;line-height:1;}
        p::first-letter {float:left;font-size:40px;font-weight:bold;line-height:1;}
    &lt;/style&gt;
</code></pre>
<pre><code class="lang-html">    <span class="hljs-tag">&lt;<span class="hljs-title">h1</span>&gt;</span>&#x6742;&#x5FD7;&#x5E38;&#x7528;&#x7684;&#x9996;&#x5B57;&#x4E0B;&#x6C89;&#x6548;&#x679C;<span class="hljs-tag">&lt;/<span class="hljs-title">h1</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-title">p</span>&gt;</span>&#x4ECA;&#x5929;&#xFF0C;&#x9633;&#x5149;&#x660E;&#x5A9A;&#xFF0C;&#x6674;&#x7A7A;&#x4E07;&#x91CC;&#xFF0C;&#x975E;&#x5E38;&#x9002;&#x5408;&#x6237;&#x5916;&#x6D3B;&#x52A8;&#xFF0C;&#x5982;&#x8E0F;&#x9752;&#x3001;&#x8FDC;&#x8DB3;&#x4E4B;&#x7C7B;&#x7684;&#x3002;&#x957F;&#x671F;&#x5750;&#x5728;&#x529E;&#x516C;&#x5BA4;&#x7684;&#x540C;&#x5B66;&#x4EEC;&#x8981;&#x591A;&#x6CE8;&#x610F;&#x8FD0;&#x52A8;&#x3002;<span class="hljs-tag">&lt;/<span class="hljs-title">p</span>&gt;</span>
</code></pre>
<blockquote>
<p>&#x6CE8;&#x610F;&#xFF1A;</p>
<ul>
<li>&#x6B64;&#x4F2A;&#x5BF9;&#x8C61;&#x4EC5;&#x4F5C;&#x7528;&#x4E8E;&#x5757;&#x5BF9;&#x8C61;&#x3002;&#x5185;&#x8054;&#x5BF9;&#x8C61;&#x8981;&#x4F7F;&#x7528;&#x8BE5;&#x4F2A;&#x5BF9;&#x8C61;&#xFF0C;&#x5FC5;&#x987B;&#x5148;&#x5C06;&#x5176;&#x8BBE;&#x7F6E;&#x4E3A;&#x5757;&#x7EA7;&#x5BF9;&#x8C61;</li>
</ul>
</blockquote>
<h3 id="efirstlineefirstline">E:first-line/E::first-line</h3>
<p>&#x8BBE;&#x7F6E;&#x5BF9;&#x8C61;&#x5185;&#x7684;&#x7B2C;&#x4E00;&#x884C;&#x7684;&#x6837;&#x5F0F;</p>
<pre><code class="lang-css">    &lt;style&gt;
        h1{font-size:16px;}
        p{width:200px;padding:5px 10px;border:1px solid #ddd;font:14px/1.5 simsun,serif,sans-serif;}
        p:first-line {color:#090;}
        p::first-line {color:#090;}

    &lt;/style&gt;
</code></pre>
<pre><code class="lang-html">    <span class="hljs-tag">&lt;<span class="hljs-title">h1</span>&gt;</span>&#x6742;&#x5FD7;&#x5E38;&#x7528;&#x7684;&#x9996;&#x5B57;&#x4E0B;&#x6C89;&#x6548;&#x679C;<span class="hljs-tag">&lt;/<span class="hljs-title">h1</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-title">p</span>&gt;</span>&#x4ECA;&#x5929;&#xFF0C;&#x9633;&#x5149;&#x660E;&#x5A9A;&#xFF0C;&#x6674;&#x7A7A;&#x4E07;&#x91CC;&#xFF0C;&#x975E;&#x5E38;&#x9002;&#x5408;&#x6237;&#x5916;&#x6D3B;&#x52A8;&#xFF0C;&#x5982;&#x8E0F;&#x9752;&#x3001;&#x8FDC;&#x8DB3;&#x4E4B;&#x7C7B;&#x7684;&#x3002;&#x957F;&#x671F;&#x5750;&#x5728;&#x529E;&#x516C;&#x5BA4;&#x7684;&#x540C;&#x5B66;&#x4EEC;&#x8981;&#x591A;&#x6CE8;&#x610F;&#x8FD0;&#x52A8;&#x3002;<span class="hljs-tag">&lt;/<span class="hljs-title">p</span>&gt;</span>
</code></pre>
<blockquote>
<p>&#x6CE8;&#x610F;&#xFF1A;</p>
<ul>
<li>&#x6B64;&#x4F2A;&#x5BF9;&#x8C61;&#x4EC5;&#x4F5C;&#x7528;&#x4E8E;&#x5757;&#x5BF9;&#x8C61;&#x3002;&#x5185;&#x8054;&#x5BF9;&#x8C61;&#x8981;&#x4F7F;&#x7528;&#x8BE5;&#x4F2A;&#x5BF9;&#x8C61;&#xFF0C;&#x5FC5;&#x987B;&#x5148;&#x5C06;&#x5176;&#x8BBE;&#x7F6E;&#x4E3A;&#x5757;&#x7EA7;&#x5BF9;&#x8C61;</li>
<li>IE9.0+&#x652F;&#x6301;&#xFF0C;&#x5176;&#x5B83;&#x6D4F;&#x89C8;&#x5668;&#x90FD;&#x652F;&#x6301;.</li>
</ul>
</blockquote>
<h3 id="ebeforeebefore">E:before/E::before</h3>
<p>&#x8BBE;&#x7F6E;&#x5728;&#x5BF9;&#x8C61;&#x524D;&#xFF08;&#x4F9D;&#x636E;&#x5BF9;&#x8C61;&#x6811;&#x7684;&#x903B;&#x8F91;&#x7ED3;&#x6784;&#xFF09;&#x53D1;&#x751F;&#x7684;&#x5185;&#x5BB9;&#x3002;&#x7528;&#x6765;&#x548C;content&#x5C5E;&#x6027;&#x4E00;&#x8D77;&#x4F7F;&#x7528;&#xFF0C;&#x5E76;&#x4E14;&#x5FC5;&#x987B;&#x5B9A;&#x4E49;content&#x5C5E;&#x6027;</p>
<pre><code class="lang-css">    &lt;style&gt;
        p{position:relative;color:#f00;font-size:14px;font-size:0\9;*font-size:14px;}
        p:before{position:absolute;background:#000;color:#000;content:&quot;&#x5982;&#x679C;&#x4F60;&#x7684;&#x80FD;&#x770B;&#x5230;&#x8FD9;&#x6BB5;&#x6587;&#x5B57;&#xFF0C;&#x8BF4;&#x660E;&#x4F60;&#x7684;&#x6D4F;&#x89C8;&#x5668;&#x53EA;&#x652F;&#x6301;E:before&quot;;font-size:14px;}
        p::before{position:absolute;background:#fff;color:#000;content:&quot;&#x5982;&#x679C;&#x4F60;&#x7684;&#x80FD;&#x770B;&#x5230;&#x8FD9;&#x6BB5;&#x6587;&#x5B57;&#xFF0C;&#x8BF4;&#x660E;&#x4F60;&#x7684;&#x6D4F;&#x89C8;&#x5668;&#x652F;&#x6301;E:before&#x548C;E::before&quot;;font-size:14px;}
    &lt;/style&gt;
</code></pre>
<pre><code class="lang-html">    <span class="hljs-tag">&lt;<span class="hljs-title">p</span>&gt;</span>Sorry, &#x4F60;&#x7684;&#x6D4F;&#x89C8;&#x5668;&#x4E0D;&#x652F;&#x6301;E:before&#x548C;E::before<span class="hljs-tag">&lt;/<span class="hljs-title">p</span>&gt;</span>
</code></pre>
<blockquote>
<p>&#x6CE8;&#x610F;:</p>
<ul>
<li>&#x9ED8;&#x8BA4;&#x4E3A;&#x884C;&#x5185;&#x5143;&#x7D20;</li>
</ul>
</blockquote>
<h3 id="eaftereafter">E:after/E::after</h3>
<p>&#x8BBE;&#x7F6E;&#x5728;&#x5BF9;&#x8C61;&#x540E;&#xFF08;&#x4F9D;&#x636E;&#x5BF9;&#x8C61;&#x6811;&#x7684;&#x903B;&#x8F91;&#x7ED3;&#x6784;&#xFF09;&#x53D1;&#x751F;&#x7684;&#x5185;&#x5BB9;&#x3002;&#x7528;&#x6765;&#x548C;content&#x5C5E;&#x6027;&#x4E00;&#x8D77;&#x4F7F;&#x7528;&#xFF0C;&#x5E76;&#x4E14;&#x5FC5;&#x987B;&#x5B9A;&#x4E49;content&#x5C5E;&#x6027; </p>
<pre><code class="lang-css">    &lt;style&gt;
        p{position:relative;color:#f00;font-size:14px;font-size:0\9;*font-size:14px;}
        p:after{position:absolute;left:0;background:#fff;color:#000;content:&quot;&#x5982;&#x679C;&#x4F60;&#x7684;&#x80FD;&#x770B;&#x5230;&#x8FD9;&#x6BB5;&#x6587;&#x5B57;&#xFF0C;&#x8BF4;&#x660E;&#x4F60;&#x7684;&#x6D4F;&#x89C8;&#x5668;&#x53EA;&#x652F;&#x6301;E:after&quot;;font-size:14px;}
        p::after{position:absolute;left:0;background:#fff;color:#000;content:&quot;&#x5982;&#x679C;&#x4F60;&#x7684;&#x80FD;&#x770B;&#x5230;&#x8FD9;&#x6BB5;&#x6587;&#x5B57;&#xFF0C;&#x8BF4;&#x660E;&#x4F60;&#x7684;&#x6D4F;&#x89C8;&#x5668;&#x652F;&#x6301;E:after&#x548C;E::after&quot;;font-size:14px;}
    &lt;/style&gt;
</code></pre>
<pre><code class="lang-html">    <span class="hljs-tag">&lt;<span class="hljs-title">p</span>&gt;</span>Sorry, &#x4F60;&#x7684;&#x6D4F;&#x89C8;&#x5668;&#x4E0D;&#x652F;&#x6301;E:after&#x548C;E::after<span class="hljs-tag">&lt;/<span class="hljs-title">p</span>&gt;</span>
</code></pre>
<blockquote>
<p>&#x6CE8;&#x610F;:</p>
<ul>
<li>&#x9ED8;&#x8BA4;&#x4E3A;&#x884C;&#x5185;&#x5143;&#x7D20;</li>
</ul>
</blockquote>
<h3 id="eplaceholder">E::placeholder</h3>
<p>&#x8BBE;&#x7F6E;&#x5BF9;&#x8C61;&#x6587;&#x5B57;&#x5360;&#x4F4D;&#x7B26;&#x7684;&#x6837;&#x5F0F;&#x3002; (&#x4E5F;&#x53EF;&#x4EE5;&#x8BF4;&#x7ED9;&#x63D0;&#x793A;&#x8BED;&#x8BBE;&#x7F6E;&#x6837;&#x5F0F;)</p>
<pre><code class="lang-css">    &lt;style&gt;
        input::-webkit-input-placeholder {
            color: green;
        }
        input:-ms-input-placeholder { // IE10+
            olor: green;
        }
        input:-moz-placeholder { // Firefox4-18
            color: green;
        }
        input::-moz-placeholder { // Firefox19+
            color: green;
        }
    &lt;/style&gt;
</code></pre>
<pre><code class="lang-html">    <span class="hljs-tag">&lt;<span class="hljs-title">input</span> <span class="hljs-attribute">id</span>=<span class="hljs-value">&quot;test&quot;</span> <span class="hljs-attribute">placeholder</span>=<span class="hljs-value">&quot;Placeholder text!&quot;</span>&gt;</span>
</code></pre>
<blockquote>
<p>&#x6CE8;&#x610F;:</p>
<ul>
<li><code>::placeholder</code>&#x4F2A;&#x5143;&#x7D20;&#x7528;&#x4E8E;&#x63A7;&#x5236;&#x8868;&#x5355;&#x8F93;&#x5165;&#x6846;&#x5360;&#x4F4D;&#x7B26;&#x7684;&#x5916;&#x89C2;&#xFF0C;&#x5B83;&#x5141;&#x8BB8;&#x5F00;&#x53D1;&#x8005;/&#x8BBE;&#x8BA1;&#x5E08;&#x6539;&#x53D8;&#x6587;&#x5B57;&#x5360;&#x4F4D;&#x7B26;&#x7684;&#x6837;&#x5F0F;&#xFF0C;&#x9ED8;&#x8BA4;&#x7684;&#x6587;&#x5B57;&#x5360;&#x4F4D;&#x7B26;&#x4E3A;&#x6D45;&#x7070;&#x8272;</li>
<li>&#x4E3A;&#x4E86;&#x66F4;&#x597D;&#x7684;&#x663E;&#x793A;&#x548C;&#x7528;&#x6237;&#x4F53;&#x9A8C;</li>
<li>&#x73B0;&#x5728;&#x6CA1;&#x6709;&#x6D4F;&#x89C8;&#x5668;&#x652F;&#x6301;,&#x6240;&#x4EE5;&#x8981;&#x52A0;&#x6D4F;&#x89C8;&#x5668;&#x524D;&#x7F00;</li>
</ul>
</blockquote>
<h3 id="eselection">E::selection</h3>
<p>&#x8BBE;&#x7F6E;&#x5BF9;&#x8C61;&#x88AB;&#x9009;&#x62E9;&#x65F6;&#x7684;&#x6837;&#x5F0F;</p>
<pre><code class="lang-css">    &lt;style&gt;
        p::-moz-selection{background:#000;color:#f00;}
        p::selection{background:#000;color:#f00;}
    &lt;/style&gt;
</code></pre>
<pre><code class="lang-html">    <span class="hljs-tag">&lt;<span class="hljs-title">h1</span>&gt;</span>&#x9009;&#x4E2D;&#x4E0B;&#x9762;&#x7684;&#x6587;&#x5B57;&#xFF0C;&#x770B;&#x770B;&#x5B83;&#x7684;&#x989C;&#x8272;<span class="hljs-tag">&lt;/<span class="hljs-title">h1</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-title">p</span>&gt;</span>&#x4F60;&#x9009;&#x4E2D;&#x8FD9;&#x6BB5;&#x6587;&#x5B57;&#x540E;&#xFF0C;&#x770B;&#x770B;&#x5B83;&#x4EEC;&#x7684;&#x6587;&#x672C;&#x989C;&#x8272;&#x548C;&#x80CC;&#x666F;&#x8272;&#xFF0C;&#x5C31;&#x80FD;&#x660E;&#x767D;::selection&#x7684;&#x4F5C;&#x7528;&#x3002;<span class="hljs-tag">&lt;/<span class="hljs-title">p</span>&gt;</span>
</code></pre>
<blockquote>
<p>&#x6CE8;&#x610F;:</p>
<ul>
<li>&#x9700;&#x8981;&#x6CE8;&#x610F;&#x7684;&#x662F;&#xFF0C;<code>::selection</code>&#x53EA;&#x80FD;&#x5B9A;&#x4E49;&#x88AB;&#x9009;&#x62E9;&#x65F6;&#x7684;<code>background-color</code>&#xFF0C;<code>color</code>&#x53CA;<code>text-shadow</code>(IE11&#x5C1A;&#x4E0D;&#x652F;&#x6301;&#x5B9A;&#x4E49;&#x8BE5;&#x5C5E;&#x6027;)</li>
<li>&#x6587;&#x5B57;&#x9009;&#x4E2D;&#x7684;&#x9AD8;&#x4EAE;&#x6548;&#x679C;(&#x6CE8;&#x610F;&#x52A0;&#x524D;&#x7F00;&#x517C;&#x5BB9;)</li>
</ul>
</blockquote>

                    
                    </section>
                
                
                </div>
            </div>
        </div>

        
        <a href="../../First/CSS/属性选择器.html" class="navigation navigation-prev " aria-label="Previous page: 属性选择器"><i class="fa fa-angle-left"></i></a>
        
        
        <a href="../../First/CSS/样式.html" class="navigation navigation-next " aria-label="Next page: CSS样式分类"><i class="fa fa-angle-right"></i></a>
        
    </div>
</div>

        
<script src="../../gitbook/app.js"></script>

    
    <script src="../../gitbook/plugins/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.js"></script>
    

    
    <script src="../../gitbook/plugins/gitbook-plugin-search/lunr.min.js"></script>
    

    
    <script src="../../gitbook/plugins/gitbook-plugin-search/search.js"></script>
    

    
    <script src="../../gitbook/plugins/gitbook-plugin-sharing/buttons.js"></script>
    

    
    <script src="../../gitbook/plugins/gitbook-plugin-fontsettings/buttons.js"></script>
    

    
    <script src="../../gitbook/plugins/gitbook-plugin-livereload/plugin.js"></script>
    

<script>
require(["gitbook"], function(gitbook) {
    var config = {"expandable-chapters-small":{},"highlight":{},"search":{"maxIndexSize":1000000},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"livereload":{}};
    gitbook.start(config);
});
</script>

        
    </body>
    
</html>
